package com.tangzx.builder.abc;

import com.tangzx.builder.abc.string.MultiName;

public class InstanceInfo extends AbcElement {
	public Trait[] traits;
	public int name_index;
	public int super_index;
	public int flags;
	public int protected_ns;
	public int[] interfaces;
	public int init_index;
	public InstanceInfo(int name_index, 
			int super_index, 
			int flags, 
			int protected_ns, 
			int[] interfaces, 
			int init_index, 
			Trait[] traits)
	{
		this.name_index = name_index;
		this.super_index = super_index;
		this.flags = flags;
		this.protected_ns = protected_ns;
		this.interfaces = interfaces;
		this.init_index = init_index;
		this.traits = traits;
	}

	@Override
	public void setAbcFile(AbcFile file) {
		super.setAbcFile(file);
		//QName qname = (QName) file.cpool.getMultiName(name_index);
	}
	
	public void checkCanMix() {
		for (Trait t : traits) {
//				NameData mn = file.cpool.getNameData(name_index);
//				System.out.println(mn);
//				Method method = file.methods[mIndex];
//				System.out.println(method);
			switch(t.getTag())
			{
			case 1:
				//Method method = file.methods[t.getMethodId()];
				//method.setCanMix(false);
				MultiName mn = file.cpool.getMultiName(t.nameIndex);
				System.out.println(mn);
				//mn.setCanMix(false);
				break;
			}
		}
	}
}
